home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
utils
/
unix
/
unzip-5.12
/
unzip.doc
< prev
next >
Wrap
Text File
|
1994-08-24
|
33KB
|
705 lines
UNZIP(1L) MISC. REFERENCE MANUAL PAGES UNZIP(1L)
NAME
unzip - list, test and extract compressed files in a ZIP
archive
SYNOPSIS
unzip [-Z] [-cflptuvz[abjnoqsCLV$]] file[.zip] [file(s) ...]
[-x xfile(s) ...] [-d exdir]
DESCRIPTION
unzip will list, test, or extract files from a ZIP archive,
commonly found on MS-DOS systems. The default behavior
(with no options) is to extract into the current directory
(and subdirectories below it) all files from the specified
ZIP archive. A companion program, zip(1L), creates ZIP
archives; both programs are compatible with archives created
by PKWARE's PKZIP and PKUNZIP for MS-DOS, but in many cases
the program options or default behaviors differ.
ARGUMENTS
file[.zip]
Path of the ZIP archive(s). If the file specification
is a wildcard, each matching file is processed in an
order determined by the operating system (or file sys-
tem). Only the filename can be a wildcard; the path
itself cannot. Wildcard expressions are similar to
Unix egrep(1) (regular) expressions and may contain:
* matches a sequence of 0 or more characters
? matches exactly 1 character
[...]
matches any single character found inside the
brackets; ranges are specified by a beginning
character, a hyphen, and an ending character. If
an exclamation point or a caret (`!' or `^') fol-
lows the left bracket, then the range of charac-
ters within the brackets is complemented (that is,
anything except the characters inside the brackets
is considered a match).
(Be sure to quote any character which might otherwise
be interpreted or modified by the operating system,
particularly under Unix and VMS.) If no matches are
found, the specification is assumed to be a literal
filename; and if that also fails, the suffix .zip is
appended. Note that self-extracting ZIP files are sup-
ported, as with any other ZIP archive; just specify the
.exe suffix (if any) explicitly.
[file(s)]
An optional list of archive members to be processed,
Info-ZIP Last change: 28 Aug 94 (v5.12) 1
UNZIP(1L) MISC. REFERENCE MANUAL PAGES UNZIP(1L)
separated by spaces. (VMS versions compiled with
VMSCLI defined must delimit files with commas instead.
See -v in OPTIONS below.) Regular expressions (wild-
cards) may be used to match multiple members; see
above. Again, be sure to quote expressions that would
otherwise be expanded or modified by the operating sys-
tem.
[-x xfile(s)]
An optional list of archive members to be excluded from
processing. Since wildcard characters match directory
separators (`/'), this option may be used to exclude
any files which are in subdirectories. For example,
``unzip foo *.[ch] -x */*'' would extract all C source
files in the main directory, but none in any subdirec-
tories. Without the -x option, all C source files in
all directories within the zipfile would be extracted.
[-d exdir]
An optional directory to which to extract files. By
default, all files and subdirectories are recreated in
the current directory; the -d option allows extraction
in an arbitrary directory (always assuming one has per-
mission to write to the directory). This option need
not appear at the end of the command line; it is also
accepted immediately after the zipfile specification,
or between the file(s) and the -x option. The option
and directory may be concatenated without any white
space between them, but note that this may cause normal
shell behavior to be suppressed. In particular,
``-d ~'' (tilde) is expanded by Unix C shells into the
name of the user's home directory, but ``-d~'' is
treated as a literal subdirectory ``~'' of the current
directory.
OPTIONS
Note that, in order to support obsolescent hardware, unzip's
usage screen is limited to 22 or 23 lines and should there-
fore be considered a reminder of the basic unzip syntax
rather than an exhaustive list of all possible flags.
-Z zipinfo(1L) mode. If the first option on the command
line is -Z, the remaining options are taken to be
zipinfo(1L) options. See the appropriate manual page
for a description of these options.
-c extract files to stdout/screen (``CRT''). This option
is similar to the -p option except that the name of
each file is printed as it is extracted, the -a option
is allowed, and ASCII-EBCDIC conversion is automati-
cally performed if appropriate. This option is not
listed in the unzip usage screen.
Info-ZIP Last change: 28 Aug 94 (v5.12) 2
UNZIP(1L) MISC. REFERENCE MANUAL PAGES UNZIP(1L)
-f freshen existing files, i.e., extract only those files
which already exist on disk and which are newer than
the disk copies. By default unzip queries before
overwriting, but the -o option may be used to suppress
the queries. Note that under many operating systems,
the TZ (timezone) environment variable must be set
correctly in order for -f and -u to work properly
(under Unix the variable is usually set automatically).
The reasons for this are somewhat subtle but have to do
with the differences between DOS-format file times
(always local time) and Unix-format times (always in
GMT) and the necessity to compare the two. A typical
TZ value is ``PST8PDT'' (US Pacific time with automatic
adjustment for Daylight Savings Time or ``summer
time'').
-l list archive files (short format). The names,
uncompressed file sizes and modification dates and
times of the specified files are printed, along with
totals for all files specified. In addition, the zip-
file comment and individual file comments (if any) are
displayed. If a file was archived from a single-case
file system (for example, the old MS-DOS FAT file sys-
tem) and the -L option was given, the filename is con-
verted to lowercase and is prefixed with a caret (^).
-p extract files to pipe (stdout). Nothing but the file
data is sent to stdout, and the files are always
extracted in binary format, just as they are stored (no
conversions).
-t test archive files. This option extracts each speci-
fied file in memory and compares the CRC (cyclic redun-
dancy check, an enhanced checksum) of the expanded file
with the original file's stored CRC value.
-u update existing files and create new ones if needed.
This option performs the same function as the -f
option, extracting (with query) files which are newer
than those with the same name on disk, and in addition
it extracts those files which do not already exist on
disk. See -f above for information on setting the
timezone properly.
-v be verbose or print diagnostic version info. This
option has evolved and now behaves as both an option
and a modifier. As an option it has two purposes:
when a zipfile is specified with no other option